package com.example.forum.services;

import com.example.forum.model.Article;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface IArticleService {

    // 发布帖子
    @Transactional  // 事务
    void createArticle(Article article);

    List<Article> selectAll();

    List<Article> selectAllByBoardId(@Param("boardId") Long boardId);

    Article selectDetailById(Long id);

    void modify(Long id, String title, String content);

    // 根据帖子id查询记录
    Article selectById(Long id);

    // 点赞操作
    void thumbsUpById(Long id);

    @Transactional
    void deleteById(Long id);

    void addOneReplyCountById(Long id);

    List<Article> selectByUserId(Long userId);
}
